package com.luluteam.pushlib.constant;

import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Guan
 * @date Created on 2018/12/17
 */
public class CtxConstant {

    /**
     * 默认:只有情景信息
     */
    public static final int ACTION_NORMAL = 0;

    /**
     * client上报情景信息，同时服务器需要经行 基于情景上下文的推荐
     */
    public static final int ACTION_CONTEXT = 1;

    /**
     * client在阅读Msg的时候上报的情景信息
     */
    public static final int ACTION_MSG = 2;

    private static final ConcurrentHashMap<Integer, String> CONTEXT_ACTION = new ConcurrentHashMap<>();


    static {
        CONTEXT_ACTION.put(ACTION_NORMAL, "Client主动上报情景信息");
        CONTEXT_ACTION.put(ACTION_CONTEXT, "Client响应Server请求，上报当前情景信息，开展基于情景上下文的推荐");
        CONTEXT_ACTION.put(ACTION_MSG, "阅读Msg的时候上报的情景信息");
    }


    /**
     * @param contextAction
     * @return
     */
    public static String getContextActionDescription(int contextAction) {
        if (CONTEXT_ACTION.containsKey(contextAction)) {
            return CONTEXT_ACTION.get(contextAction);
        }
        return "未知：Context Action=" + contextAction;
    }


}
